package com.sutuijingling.result;

import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import org.apache.commons.io.b;

public class w {
    static String i = "/data/data/jp.jun_nama.test.utf7ime/files/recoverStatus.txt";
    static String j = "/data/data/jp.jun_nama.test.utf7ime/files/recoverLogs.txt";
    static File k = new File(j);
    long a = 0;
    long b = 0;
    long c = 0;
    long d = 0;
    int e = -1;
    int f = -1;
    int g = 0;
    String h;

    public static w a(long j, int i) {
        return a(j, i, false);
    }

    public static w a(long j, int i, boolean z) {
        return new w();
    }

    public static void a(String str, Object... objArr) {
        try {
            b.a(k, new SimpleDateFormat("[yyyy-MM-dd HH:mm:ss] ").format(Long.valueOf(System.currentTimeMillis())) + String.format(str, objArr) + "\n");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static w b() {
        File file = new File(i);
        if (!file.exists()) {
            return null;
        }
        try {
            w wVar = (w) WorkStatus.gson.a(b.b(file), w.class);
            a("{read}:" + wVar.a(), new Object[0]);
            return wVar;
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }

    public static void c() {
        File file = new File(i);
        com.sutuijingling.utils.b.b(" delete file :" + file, new Object[0]);
        file.deleteOnExit();
    }

    public String a() {
        return String.format("missionId[%d],retry[%d],origin[%s] status[%s]", new Object[]{Long.valueOf(this.a), Integer.valueOf(this.g), WorkStatus.findTip(this.f), WorkStatus.findTip(this.e)});
    }

    public void d() {
        a(this.a, this.e, true);
    }

    public long e() {
        return this.a;
    }

    public int f() {
        return this.e;
    }

    public String toString() {
        return "RecoverParam [missionId=" + this.a + ", prevMissionid=" + this.b + ", createTs=" + this.c + ", updateTs=" + this.d + ", currStatus=" + this.e + ", prevStatus=" + this.f + ", retryCount=" + this.g + ", msg=" + this.h + "]";
    }
}
